<template>
  <div>
    首页--- {{ newGender }}
  </div>
</template>
<script>
import employeesData from '@/api/constant/employees'
export default {
  data() {
    return {
      gender: 1
    }
  },
  computed: {
    newGender() {
      // employeesData   gender
      //  find:找出满足条件的项，返回的是相应项的item值
      const findItem = employeesData.gender.find(item => {
        console.log(item.id, this.gender)
        return +item.id === this.gender
      })
      console.log(findItem)
      return findItem.value
    }
  }
}
</script>
<style>
</style>
